export default {
  yearIntervals: [
    {start: 2100, end: -100, yearLength: 0.3},
    {start: -100, end: -500, yearLength: 0.2},
    {start: -500, end: -1000, yearLength: 0.1},
    {start: -1000, end: -5000, yearLength: 0.025},
    {start: -5000, end: -5e6, yearLength: 0.0002}
  ],

  years: [
    -2e6,
    -1e6,
    -500e3,
    -5e3, -4e3, -3e3, -2e3, -1e3,
    -500, -400, -300, -200, -100,
    0,
    100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000
  ],

  yearZeroOffsets: [ 0, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50 ],

  yearZeroOffsetIndex: 0,

  mapYearToLandscapeZ: function mapYearToLandscapeZ(year, offset) {
    year = year || 0;
    if (year === 0 && offset) {
      year += this.yearZeroOffsets[this.yearZeroOffsetIndex];
      this.yearZeroOffsetIndex = (this.yearZeroOffsetIndex + 1) % this.yearZeroOffsets.length;
    }
    var z = 0;
    for (var i=0; i<this.yearIntervals.length; i++) {
      var iv = this.yearIntervals[i];
      if (year > iv.start) {
        break;
      }
      var d = Math.min(iv.start - iv.end, iv.start - year);
      z += d * iv.yearLength;
    }
    return 1900*0.2 + 100*0.3 + 50*0.4 + 50*0.8 - z;
  },
}





